package com.ucode.model.hrm.enums;

import com.ucode.tool.base.IntArrayValuable;

import java.util.Arrays;

/**
 * 请假类型枚举类
 */
public enum HrmLeaveApplyTypeEnum implements IntArrayValuable {

    ANNUAL(1, "年假"),
    PERSONAL(2, "事假"),
    SICK(3, "病假"),
    COMPENSATORY(4, "调休"),
    MARITAL(5, "婚假"),
    BEREAVEMENT(6, "丧假"),
    MATERNITY(7, "产假");


    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(HrmLeaveApplyTypeEnum::getCode).toArray();

    public Integer code;

    public String message;

    HrmLeaveApplyTypeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
    
    public static HrmLeaveApplyTypeEnum get(Integer code){
        for(HrmLeaveApplyTypeEnum dataPermissionType : values()){
            if(dataPermissionType.code == code){
                return dataPermissionType;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public int[] array() {
        return ARRAYS;
    }
}